//-----------------------------------------------------------------------
// <copyright file="TypeBusinesService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class TypeBusinesService
    {
        #region TypeBusines

        public static void CreateTypeBusines(TypeBusines typeBusines)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                typeBusinesDAO.CreateTypeBusines(typeBusines);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateTypeBusinesException, ex);
            }
        }        

        public static void UpdateTypeBusines(TypeBusines typeBusines)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                typeBusinesDAO.UpdateTypeBusines(typeBusines);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateTypeBusinesException, ex);
            }
        }        

        public static void DeleteTypeBusines(int typeBusinessID)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                typeBusinesDAO.DeleteTypeBusines(typeBusinessID);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteTypeBusinesException, ex);
            }
        }
        
        public static TypeBusines GetTypeBusines(int typeBusinessID)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                return typeBusinesDAO.GetTypeBusines(typeBusinessID);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetTypeBusinesException, ex);
            }
        }                

        public static TypeBusinesCollection GetTypeBusinesList(TypeBusinesColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                return typeBusinesDAO.GetTypeBusinesList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetTypeBusinesListException, ex);
            }
        }        

        public static TypeBusinesCollection GetTypeBusinesList(TypeBusinesColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                return typeBusinesDAO.GetTypeBusinesList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetTypeBusinesListException, ex);
            }
        }        

	    public static TypeBusinesCollection GetTypeBusinesListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                return typeBusinesDAO.GetTypeBusinesListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetTypeBusinesListException, ex);
            }
        }        

        public static TypeBusinesCollection GetTypeBusinesListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                TypeBusinesDAO typeBusinesDAO = new TypeBusinesDAO();
                return typeBusinesDAO.GetTypeBusinesListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetTypeBusinesListException, ex);
            }
        }        

        #endregion
    }
}